{include file="admin/public/header" /}
<div class="aw-content-wrap">
    <div class="mod">
        <div class="mod-head">
            <h3>
                <span class="pull-left"><?php e('编辑用户资料'); ?></span>
            </h3>
        </div>
        <div class="tab-content mod-content">
                <form action="{:url('ucenter/ajax/changeinfo')}" class="cmzForm" enctype="multipart/form-data" method="post" onsubmit="return false">
                <table class="table table-striped">
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('用户名'); ?>:</span>
                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="user_name" type="text" value="<?php echo $user_name; ?>" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('邮箱'); ?>:</span>
                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="email" type="text" value="<?php echo $email; ?>" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('密码'); ?>:</span>
                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="password" type="password" value="" />

                                    <span class="help-block"><?php e('不更改请留空'); ?></span>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <!-- <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label">居住地:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <select name="province" class="select_area form-control"></select>
                                </div>
                                <div class="col-sm-3 col-xs-3">
                                    <select name="city" class="select_area form-control collapse"></select>
                                </div>
                            </div>
                        </td>
                    </tr> -->
                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label">职业:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <select name="job_id" class="form-control">
                                     <option value="0">--</option>
                                    <?php foreach ($jobs as $key => $v): ?>
                                        
                                         <option value="{$v.id}" {if condition="$v['id']==$job_id"} selected=""{/if}>{$v.job_name}</option>
                                    <?php endforeach ?>
                                       
                                        
                                    </select>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label"><?php e('手机号码'); ?>:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="mobile" type="text" value="{$mobile}" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <!-- <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label">QQ:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="qq" type="text" value="{$qq}" />
                                </div>
                            </div>
                        </td>
                    </tr> -->
                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label"><?php e('常用邮箱'); ?>:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="common_email" type="text" value="{$common_email}" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label"><?php e('网站'); ?>:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="homepage" type="text" value="{$homepage}" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label"><?php e('一句话介绍'); ?>:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="signature" type="text" value="{$signature}" />
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label"><?php e('积分'); ?>:</label>

                              <!--   <div class="col-sm-5 col-xs-8">
                                     &nbsp; <a class="btn btn-xs btn-danger" href="">操作积分</a>
                                </div> -->
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('邮箱激活状态'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        <div class="checkbox i-checks checkbox-inline">
										<label type="button" class="btn mod-btn-color">
                                            <input type="radio" name="valid_email" value="1"<?php if ($valid_email == 1) { ?> checked="checked"<?php } ?> /> <?php e('是'); ?>
                                        </label>
								</div>

                                        <div class="checkbox i-checks checkbox-inline">
										<label type="button" class="btn mod-btn-color">
                                            <input type="radio" name="valid_email" value="0"<?php if ($valid_email == 0) { ?> checked="checked"<?php } ?> /> <?php e('否'); ?>
                                        </label>
								</div>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('认证用户'); ?>:</span>
                                <div class="col-sm-8 col-xs-8">
                                    <div class="checkbox i-checks checkbox-inline">
										<label class="checkbox-inline"><input type="radio" name="verified" value=""<?php if ($verified == '') { ?> checked="checked"<?php } ?> /><?php e('无'); ?></label>
								</div>
                                    <div class="checkbox i-checks checkbox-inline">
										<label class="checkbox-inline"><input type="radio" name="verified" value="personal"<?php if ($verified == 'personal') { ?> checked="checked"<?php } ?> /><?php e('个人认证'); ?></label>
								</div>
                                    <div class="checkbox i-checks checkbox-inline">
										<label class="checkbox-inline"><input type="radio" name="verified" value="enterprise"<?php if ($verified == 'enterprise') { ?> checked="checked"<?php } ?>/><?php e('机构认证'); ?></label>
								</div>
                                    <!-- &nbsp; <a href="admin/user/verify_approval_edit" class="btn btn-xs btn-danger">编辑认证审核资料</a> -->
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                     
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('头像'); ?>:</span>
                                <div class="col-sm-1">
                                    <p style="border:1px dotted #ddd;padding:2px;">
                                        <img src="{if condition='$avatar_file'}{$avatar_file}{else}/static/images/avatar-mid-img.png{/if}" alt="" class="weupload_img" style="width:120px;height:120px;" />
                                        <input type="hidden" name="avatar_file" value="{if condition='$avatar_file'}{$avatar_file}{/if}">
                                    </p>
                                    <p class="weupload" style="text-align:center">设置头像</p>
                                 </div>
                        </td>
                    </tr>
                    <script type="text/javascript">
                        $(document).ready(function() {
                                                 // 初始化Web Uploader
                        var uploader = WebUploader.create({

                            // 选完文件后，是否自动上传。
                            auto: true,
                            // swf文件路径
                            swf: '/static/plus/js/plugins/ueditor/third-party/webuploader/Uploader.swf',
                            // 文件接收服务端。
                            server: "{:url('asset/upload/uploads',['dir'=>'avatar'])}",
                            // 选择文件的按钮。可选。
                            // 内部根据当前运行是创建，可能是input元素，也可能是flash.
                            pick: '.weupload',
                            // 只允许选择图片文件。
                            accept: {
                                title: 'Images',
                                extensions: '{:trim(getset('allowed_upload_types'),',')}',
                                // mimeTypes: 'image/*'
                            }

                        });
                        // 文件上传过程中创建进度条实时显示。
                        // uploader.on( 'uploadProgress', function(file,percentage) {
                        //     $('.weupload').html("上传:"+percentage+'%')
                        // });

                        // 文件上传失败，显示上传出错。
                        uploader.on( 'uploadError', function(file,json) {
                            cmzAlert(json.msg);
                        });

                       // 完成上传完了，成功或者失败，先删除进度条。
                        uploader.on( 'uploadSuccess', function(file,json) {
                            $( '.weupload_img' ).attr('src', json.file);
                            $("input[name='avatar_file']").val(json.file)
                        });
                        // 完成上传完了，成功或者失败，先删除进度条。
                        // uploader.on( 'uploadComplete', function( file ) {
                        //    $('.weupload').html("设置头像")
                        // });

                        });

                    </script>
                  <!--   <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('会员组'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr> -->

                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label">所属组:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <select name="group_id" class="form-control">
                                      
                                        {volist name="category" id="v"}
                                        <option {if condition="$v['group_id']==$group_id"} selected=""{/if} value="{$v.group_id}"selected="selected">{$v.group_name}</option>
                                        {/volist}
                                    </select>
                                </div>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('封禁用户'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        <div class="checkbox i-checks checkbox-inline">
										<label type="button" class="btn mod-btn-color">
                                            <input type="radio" name="forbidden" value="1"<?php if ($forbidden == 1) { ?> checked="checked"<?php } ?> /> <?php e('是'); ?>
                                        </label>
								</div>

                                        <div class="checkbox i-checks checkbox-inline">
										<label type="button" class="btn mod-btn-color">
                                            <input type="radio" name="forbidden" value="0"<?php if ($forbidden == 0) { ?> checked="checked"<?php } ?> /> <?php e('否'); ?>
                                        </label>
								</div>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('注册时间'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        <?php echo date_friendly($reg_time); ?>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>

                    <?php if ($this->user['reg_ip']) { ?>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('注册 IP'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        <?php echo long2ip($reg_ip); ?>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>

                    <?php if ($last_ip) { ?>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('上次登录 IP'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        <?php echo long2ip($last_ip); ?>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>

                    <?php if ($last_login) { ?>
                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('上次登录时间'); ?>:</span>
                                <div class="col-sm-6 col-xs-8">
                                    <div class="btn-group mod-btn">
                                        <?php echo date_friendly($last_login); ?>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                    <?php } ?>

                    <tr>
                        <td>
                            <div class="form-group">
                                <span class="col-sm-4 col-xs-3 control-label"><?php e('性别'); ?>:</span>
                                <div class="col-sm-8 col-xs-8">
                                    <div class="checkbox i-checks checkbox-inline">
										<label class="checkbox-inline"><input type="radio" name="sex" value="1"<?php if ($sex == 1) { ?> checked="checked"<?php } ?> /><?php e('男'); ?></label>
								</div>
                                    <div class="checkbox i-checks checkbox-inline">
										<label class="checkbox-inline"><input type="radio" name="sex" value="2"<?php if ($sex == 2) { ?> checked="checked"<?php } ?> /><?php e('女'); ?></label>
								</div>
                                    <div class="checkbox i-checks checkbox-inline">
										<label class="checkbox-inline"><input type="radio" name="sex" value="3"<?php if (!$sex OR $sex == 3) { ?> checked="checked"<?php } ?>/><?php e('保密'); ?></label>
								</div>
                                </div>
                            </div>
                        </td>
                    </tr>

                    <tr>
                        <td>
                            <div class="form-group">
                                <label class="col-sm-4 col-xs-3 control-label"><?php e('可用邀请名额'); ?>:</label>

                                <div class="col-sm-5 col-xs-8">
                                    <input class="form-control" name="invitation_available" type="text" value="<?php echo $invitation_available ?>"/>
                                </div>
                            </div>
                        </td>
                    </tr>

                <tfoot>
                <tr>
                    <td>
                    <input type="hidden" value="{$uid}" name="uid">
                        <input type="button" value="保存设置" class="btn btn-primary center-block cmzPost"  />
                    </td>
                </tr>
                </tfoot>
            </table>
            </form>
        </div>
    </div>
</div>
{include file="admin/public/footer" /}